/*
 * Middleware
 * Copyright (C) 2010/11
 * Riccardo Pulvirenti, Giuseppe Ravidà, Andrea Tino
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANDABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see http://www.gnu.org/licenses
 */

/*!
 * File: task_data.hpp
 */

#ifndef _TASK_DATA_HPP_
#define _TASK_DATA_HPP_

#include "interface.hpp"
#include "data.hpp"

//-----------------------------------------------------------------------------
// Interface definitions
namespace middleware {
/*! \class TaskData
 * \brief Interface to interconnect Manager and Worker.
 *
 * This interface is used by Manager to send Data to a Worker and by Worker to
 * receive Data by a Manager. Data is exchanged when an executable task has been
 * processed by a Manager and its binaries must be sent to the chosen Worker along
 * with its TaskDescriptor.
 */
interface TaskData {
public:
	/*!
	 * Sends Data to a specified Worker.
	 * \param data Data to be sent.
	 */
	virtual void send_data(Data data) = 0;
	/*!
	 * Receives Data from a Manager.
	 * \return Returns a Data object. This call is blocking (generally) and
	 * causes the caller to wait for a Data to arrive.
	 */
	virtual Data recv_data() = 0;
}; /* TaskData */
} /* middleware */

#endif
